﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

using LRSTaxServices.Biz;

public partial class AdminMaster : System.Web.UI.MasterPage
{
    #region Event Handlers

    #region Page Load

    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["username"] == null)
                Response.Redirect("sessionexpire.aspx");
            SubAdmin logediduser = SubAdmin.GetUserByUserLogin(Session["username"].ToString());
            Session["userfullname"] = logediduser.FirstName + " " + logediduser.LastName;
            foreach (SubAdminRole obj in logediduser.Roles)
            {
                HideAndSeekMenu(obj.RoleName);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

    #endregion

    #endregion

    #region Privates

    private void HideAndSeekMenu(string rolename)
    {
        switch (rolename)
        {
            case "Site Administrator":
                liSubadmin.Visible = true;
                lischedular.Visible = true;
                lisetting.Visible = true;
                lirole.Visible = true;
                litaxnews.Visible = true;
                liuserdoc.Visible = true;
                litransaction.Visible = true;
                liclientsupport.Visible = true;
                licontactus.Visible = true;
                break;   
        }

    }

    #endregion
}
